package ru.spbau.design.snmp.android.viewer.model;

import java.util.ArrayList;
import java.util.List;

public final class Network {
	
	public Network(String id) {
		this.id = id;
		this.subNets = new ArrayList<SubNet>();
		this.routers = new ArrayList<Router>(); 
	}

	public List<Router> getRouters() {
		return routers;
	}

	public List<SubNet> getSubNets() {
		return subNets;
	}

	public String getId() {
		return id;
	}

	public void addRouter(Router router) {
		routers.add(router);
	}

	public void addSubNet(SubNet subNet) {
		subNets.add(subNet);
	}

	public SubNet getSubNetById(String id) {
		for(SubNet subNet : subNets) {
			if (subNet.getId().equals(id)) {
				return subNet;
			}
		}
		return null;
	}

	private ArrayList<Router> routers;
	private ArrayList<SubNet> subNets;
	private final String id;
}
